home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!ues5.cern.ch
- From: Dan Pop <Dan.Pop@cern.ch>
- Newsgroups: comp.lang.c
- Subject: Re: Limit on #bytes inside of struct?
- Date: Sun, 11 Feb 1996 21:36:24 +0100
- Organization: CERN European Lab for Particle Physics
- Message-ID: <9602112036.AA01555@ues5.cern.ch>
- References: <4feg1d$d4g@cville-srv.wam.umd.edu> <4ffg6b$ivd@sparcserver.lrz-muenchen.de> <4ffohq$1gb@mordred.gatech.edu> <9602091718.AA18553@ues5.cern.ch> <4fkgns$8t9@sparcserver.lrz-muenchen.de>
- X-NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
- X-Mail2News-Path: mail1.cern.ch!ues5.cern.ch
-
- watzka@stat.uni-muenchen.de (Kurt Watzka) writes:
-
- >Dan Pop <danpop@ues5.cern.ch> writes:
- >
- >>james@amber.biology.gatech.edu (James McIninch) writes:
- >
- >>>ua302aa@lrz-muenchen.de wrote:
- >>>: jsquires@wam.umd.edu (jeffrey d squires) writes:
- >>>
- >>>: >Is there a limit on the number of bytes allowed inside of a struct?
- >>>
- >>>: Yes, there is a limit on the number of bytes allowed in one
- >>>: object. That limit is 32k.
- >>>
- >>>No. There is no limit. Individual implementations of compilers or OS's may
- >>>impose a limit, but there is no limit that is integral to the C languag itself.
- >
- >>James is right. What the C language requires is that a compiler-imposed
- >>limit for the size of an object cannot be lower than 32k.
- >
- >Yes, James is right, but you still cannot have objects of more than
- >32k in a _portable_ C program, so for portable programs there is
- >a limit of 32k for the size of an object. You cannot rely on the
- >assumption that all compilers will support larger objects.
-
- Sorry to disappoint you, but you can't write a _portable_ C program if you
- rely exclusively on the standard, which says:
-
- 2.2.4.1 Translation limits
-
- The implementation shall be able to translate and execute at least
- one program that contains at least one instance of every one of the
- following limits:
- ...
- * 32767 bytes in an object (in a hosted environment only)
- ...
-
- The keywords here are "at least one program". If your program containing
- an object of 32767 bytes (or even less) is not the "one" supported by the
- compiler, you're out of luck :-)
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-